﻿#pragma once

#include "./ViewpointFeatureHistogramModel.h"
#include "pcl/includePcl.h"
#include "../common/BasePclProvider.h"
#include <pcl/visualization/pcl_plotter.h>

/// <summary>
/// ViewpointFeatureHistogramProvider
/// </summary>
class ViewpointFeatureHistogramProvider : public BasePclProvider
{
    Q_OBJECT

public:
    ViewpointFeatureHistogramProvider();

public:
    void initEditor(QtTreePropertyBrowser* editor);
    void valueChanged(QtProperty*, double) override;
    void valueChanged(QtProperty*, QString) override;
    void valueChanged(QtProperty*, int) override;
    void valueChanged(QtProperty*, bool) override;
    void valueChanged(QtProperty*, const QColor&) override;
    void close() override;
    void doLoadPcd();
    void doAction();

private:
    /**
     * @brief Estimating VFH signatures for a set of points
     * https://pcl.readthedocs.io/projects/tutorials/en/master/vfh_estimation.html
     * data: ???
     * @param cloud
     * @param model
     * @return
     */

    void impl(
        pcl::PointCloud<pcl::PointXYZ>::Ptr cloud,
        pcl::PointCloud<pcl::Normal>::Ptr normals,
        ViewpointFeatureHistogramModel& model
    );

    pcl::visualization::PCLPlotter* plotter_;
};
